package com.zhang.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhang.entity.Menu;
import com.zhang.responce.Result;
import com.zhang.service.MenuService;
import com.zhang.utils.MenuTreeBuild;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author Zhang
 * @since 2022-03-02
 */
@RestController
@RequestMapping("/menu")
@Api(value = "菜单列表模块", tags = "菜单列表接口")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("/menuTree")
    @ApiOperation(value = "获取菜单树数据", tags = "")
    public Result findMenuTree() {
        List<Menu> menuTree = menuService.findMenuTree();
        return Result.ok().data("menuTree", menuTree);
    }

}

